package huanzhao.erp.domain.types;

import lombok.Getter;

/**
 * @author April
 * 2024/6/18 上午10:58
 * @version 1.0
 */
@Getter
public enum DepartmentType {
    PURCHASE, WAREHOUSE, REPAIR, QC;

    @Override
    public String toString() {
        return super.name().toLowerCase();
    }

    /**
     * 通过部门代号获取部门名称
     *
     * @param department 部门代号
     * @return String
     * 2024/7/21 下午8:49:15
     */
    public static DepartmentType of(int department) {
        return switch (department) {
            case 0 -> DepartmentType.PURCHASE;
            case 1 -> DepartmentType.REPAIR;
            case 2 -> DepartmentType.WAREHOUSE;
            default -> DepartmentType.QC;
        };
    }
}
